package cn.com.dbappsecurity.service.impl;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;

import cn.com.dbappsecurity.frame.Constant;
import cn.com.dbappsecurity.service.ISystem;

public class SystemImpl extends BaseServiceImpl implements ISystem{

	/**
	 * 换肤
	 * @param response
	 * @param skin
	 * @throws Exception
	 */
	@Override
	public void changeSkin(HttpServletResponse response, String skin)throws Exception {
		Cookie cookie = new Cookie(Constant.SKIN_KEY,skin);
		cookie.setMaxAge(3600 * 24 * 365);
		response.addCookie(cookie);
	}

	/**
	 * 换语言
	 * @param response
	 * @param language
	 * @throws Exception
	 */
	@Override
	public void changeLanguage(HttpServletResponse response, String language)
			throws Exception {
		Cookie cookie = new Cookie(Constant.LANGUAGE_KEY,language);
		cookie.setMaxAge(3600 * 24 * 365);
		response.addCookie(cookie);
	}

}
